<? $is_active = tsAdminDash::isActive($item) ?>

<? if (@$item['show'] !== false): ?>

  <a href="<?=url_for($item['url']) ?>" class="sub <? if ($is_active): ?> active<? endif ?>">
  
    <? if (tsAdminDash::getProperty('resize_mode') == 'html'): ?>
    
      <?=image_tag($item['image'], array('alt' => $item['name'], 'width' => '16', 'height' => '16', 'align' => "absmiddle")) ?>
    <? else: ?>
    
      <?=image_tag($item['image'], array('alt' => $item['name'], 'align' => "absmiddle")) ?>
    <? endif ?>
    
    <span><?=$item['name'] ?></span>
  </a>
<? endif ?>


<? if (isset($item['tabs']) && $is_active): ?>

  <? slot('sf_admin.tabs') ?>

    <div id="sf_tabs" class="ui-tabs ui-widget ui-widget-contents">
      <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
      <? $i=0; ?>
      <? foreach ($item['tabs'] as $titleTab => $tab): $i++; ?>
        <? $is_active = sfContext::getInstance()->getController()->genUrl($tab['url']) == $_SERVER["REQUEST_URI"]; ?>
        <li class="ui-state-default ui-corner-top<? echo (($is_active)? ' ui-tabs-selected ui-state-active': ''); ?>"><?=link_to($titleTab, $tab['url']) ?></li>
      <? endforeach; ?>
      </ul>
    </div>
  <? end_slot(); ?>

<? endif ?>
